<template>
 <simple-layout title="邀请好友">
  <div class="header">
        <div class="headBox">
          <div class="item">
          我的邀请码
          </div>
          <div class="item  item_code">
          {{userInfo.inviteCode}}
          </div>
          <div class="item  code_btns">
          复制
          </div>
        </div>

    </div>
    <div class="content">
          <h4>我的战绩</h4>
          <div class="myContainer">
              <div class="myitem">
                   <div class="subitem ">一级好友数0</div>
                    <div class="subitem doubleItem">累计获得CGDX </div>
              </div>

              <div class="myitem">
                  <div class="subitem ">二级好友数0</div>
                  <div class="subitem doubleItem">累计获得CGDX </div>
               </div>
          </div>
           <div class="guize">
              <span class="reward"> 奖励规则</span>

           </div>
           <div class="list">
              <div class="list_item"> 1绩出众的人会获得现绩出众的人会获得现金奖励绩出众的人会获得现金奖励金奖励。</div>
              <div class="list_item">2绩出众的人会获得现金奖励。 </div>
              <div class="list_item">3绩出众的人会获得现金奖励。 </div>
           </div>
            <h4>邀请记录</h4>
            <div class="guize">
                <span class="reward"> 被邀请人完成实名认证</span>
            </div>
            <table width="100%">
                <tr class="last_childer">
                  <td>哪月</td>
                  <td>电话</td>
                  <td>状态</td>
                </tr>
                <tr v-for="item in inviteList">
                  <td>{{item.createTime}}</td>
                  <td>{{item.userMobile}}</td>
                  <td>{{item.isCert===0?'已完成':'未完成'}}</td>
                </tr>
             </table>

      </div>

    <div class="footer" @click="toInvitationQrCode">
      生成邀请卡
    </div>
 </simple-layout>

</template>


<script>
  import SimpleLayout from '../../components/SimpleLayout';
  import UserService from '../../service/user';

  export default {
    name: "Login",
    components: {
      //someComponent
      SimpleLayout
    },
    props: {},
    data() {
      return {
        msg: "Hello Vue.js",
        userInfo: JSON.parse(this.$cookie.get('user')),
        filter:{
          pageSize:10,
          pageNum:1,
        },
        inviteList:[]
      }
    },
    computed: {},
    watch: {},
    mounted: function () {
      this.getInviteList()
    },
    methods: {
      toInvitationQrCode(){
        this.$router.push('/invitation/qrCode');
      },
      getInviteList(){
        UserService.inviteList(this.filter).then(res=>{
          if(res.status == 200){
            this.inviteList = this.inviteList.concat(res.resultData.list);
            console.log(this.inviteList)
          }
        })
      }
    }
  }
</script>


<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.header{
 background-image: url('../../assets/meet/banner@2x.png');
 height: 30vh;
    width: 100%;
    background-size: cover;
}
.headBox{
  display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    align-content: center;
    padding-top: 6vh;
   color: #fff;

}
.last_childer{
  background:#CACAC9;
  color:#fff;
}
.item{
  padding:12px;
}
.item_code{
  font-size: 8vw;
  font-weight: bold;
}
.code_btns{
  border-radius: 30px;
    border: 2px solid #fff;
    padding: 6px 50px;
    margin-top: 12px;
}
.content{
  background: #fff;

}
.reward{
  border-left:6px solid #6092EF;
  padding:0px 3vh;
}
h4{
  padding:2vh;
  color: #7C86A1;
}
.myContainer{
  display: flex;
    justify-content: space-around;
    align-items: center;
}
.doubleItem{
  background:#EDF3FF;
  border-radius: 2vw;

}
.list{
    text-align: start;
    padding: 0vh 3vh;
}
.subitem{
  padding: 4vh;
   color: #7C86A1;
}
.list_item{
  padding: 2vh 0vh;
}
.guize{
    text-align: start;
    padding: 3vh;
}
table tr{
  padding:2vh 0px;
}
.footer{
    background:linear-gradient(to right,#65AEFD,#5C7CE5);
    height: 8vh;
    line-height: 8vh;
    color: #fff;

}
</style>
